package com.ffox.mapper;

import com.ffox.entity.GroupChatFile;
import com.ffox.entity.GroupChatMessage;
import com.ffox.entity.GroupChatNotification;
import com.ffox.service.dto.MemberDto;
import org.apache.ibatis.annotations.Mapper;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface UserGroupchatMapper {

    // 消息相关
    Integer insertMessage(GroupChatMessage message);
    GroupChatMessage getLastMessage();
    Integer updateMessage(Long messageId , Byte status);
    List<GroupChatMessage> getMessages(Long classId);
    String getUserAvatarByNumber(String userNum);

    // 文件相关
    Integer insertFile(GroupChatFile file);
    Integer updateFile(Long fileId, Byte status, LocalDateTime deletedAt);
    List<GroupChatFile> getFiles(Long classId);

    // 通知相关
    Integer insertNotification(GroupChatNotification notification);
    Integer updateNotification(Long notificationId, Byte status,LocalDateTime deletedAt);
    List<GroupChatNotification> getNotifications(Long classId);
//    已读人数
    Integer updateNotificationAsRead(Long notificationId,Long readCount);
//是否置顶
    Integer updateNotificationIsPinned(Long notificationId, Byte IsPinned);

    List<MemberDto> getClassMembers(Long classId);



}
